package uuid

import (
	//"fmt"
	"time"
	//"strconv"
	"math/rand"
	//"reflect"
	//"encoding/json"
)
var incr = 0

/*
func GetOrderId() (int64, error) {
	date := time.Now().Format("060102")
	second := time.Now().Hour()*3600 + time.Now().Minute()*60 + time.Now().Second()
	secondStr := fmt.Sprintf("%05d", second)
	incr++
	incrStr := fmt.Sprintf("%05d", incr) // 1秒订单<10000
	orderStr := date + secondStr + incrStr
	orderId, err := strconv.ParseInt(orderStr, 10, 64)
	if err != nil {
		return 0, err
	}
	return orderId, nil
}
*/

func GetShopId() (int64) {
	shopId := randInt(1000, 5000000)
	return int64(shopId)
}

func GetUserId() (int64) {
	userId := randInt(10000, 50000000)
	return int64(userId)
}

func randInt(min int, max int) int {
	rand.Seed(time.Now().UTC().UnixNano())
	return min + rand.Intn(max-min)
}
